package com.ruoyi.app.controller;

import com.ruoyi.cms.domain.CmsDjContent;
import com.ruoyi.cms.service.ICmsDjContentService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 党建Controller
 * 
 * @author hct
 * @date 2022-01-22
 */
@RestController
@RequestMapping("/app/public/djcontent")
public class AppDjContentController extends BaseController
{
    @Autowired
    private ICmsDjContentService cmsDjContentService;

    /**
     * 查询党建列表
     */
    @GetMapping("/list")
    public TableDataInfo list(CmsDjContent cmsDjContent)
    {
        startPage();
        List<CmsDjContent> list = cmsDjContentService.selectCmsDjContentList(cmsDjContent);
        return getDataTable(list);
    }



    /**
     * 获取党建详细信息
     */
    @GetMapping(value = "/detail/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(cmsDjContentService.selectCmsDjContentById(id));
    }


}
